<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('parent_id')->defalut(0)->comment('上级分类');
            $table->char('type', 32)->nullable()->comment('类型（default）');
            $table->char('title', 32)->comment('名字');
            $table->char('nickname', 64)->nullable()->comment('昵称');
            $table->char('flag', 32)->nullable()->comment('推荐（index hot..）');
            $table->string('image', 255)->nullable()->comment('图标');
            $table->string('description', 255)->nullable()->comment('简介');
            $table->integer('order')->default(0)->comment('排序');
            $table->tinyInteger('status')->default(1)->comment('状态(显示/隐藏)');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categories');
    }
}
